const axios = require('axios');
const MockAdapter = require('axios-mock-adapter');
const normalAxios = axios.create();
const mockAxios = axios.create();
import { jsonToTree } from "../utils/tools";
import Config from "./config";
import reqTools from "../utils/reqTools";

// mock 数据
var mock = new MockAdapter(mockAxios);

mock.onPut('/password').reply((config) => {
  return new Promise(function (resolve, reject) {
    reqTools.put('/api/sysUser/modifyPassword',
      config.data,
      { headers: { 'Content-Type': 'application/json' } }
    ).then((res) => {
      resolve([200, res]);
    }).catch((err) => {
      reject([500, err]);
    });
  });
});


export default mockAxios;
